﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Core;
using System.Collections;

namespace Yuanlin.Business
{
    public class NewsRequest : TEntityRequest<News>
    {
        public NewsRequest()
        {
            int? entityId = GetParameterValue<int?>(YuanlinParameterName.NewsId);
            if (entityId.HasValue)
            {
                EntityId = entityId.Value;
            }
        }
    }
    public class NewsListRequest : TEntityListRequest<News>
    {
        private int? childCategoryId = GetParameterValue<int?>(YuanlinParameterName.ChildCategoryId);
        private int? parentCategoryId = GetParameterValue<int?>(YuanlinParameterName.ParentCategoryId);
        private string title = GetParameterValue<string>(YuanlinParameterName.Title);
        private string companyTypes = GetParameterValue<string>(YuanlinParameterName.CompanyTypes);

        public int? ChildNewsCategoryId
        {
            get
            {
                return childCategoryId;
            }
            set
            {
                childCategoryId = value;
            }
        }
        public int? NewsCategoryId
        {
            get
            {
                return parentCategoryId;
            }
            set
            {
                parentCategoryId = value;
            }
        }
        public string Title
        {
            get
            {
                if (!string.IsNullOrEmpty(title))
                {
                    return string.Format("%{0}%", title);
                }
                return "";
            }
            set
            {
                title = value;
            }
        }
        public string CompanyTypes
        {
            get
            {
                if (!string.IsNullOrEmpty(companyTypes))
                {
                    return string.Format("%{0}%", companyTypes);
                }
                return "";
            }
            set
            {
                companyTypes = value;
            }
        }
    }
    public class NewsReply : EntityReply
    {
    }
}